package com.igeek.controller;


import com.igeek.model.claims.Claims;
import com.igeek.model.claims.InsuranceFlowable1;
import com.igeek.result.Result;
import com.igeek.service.IClaimsService;
import com.igeek.vo.process.ApprovalDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author author
 * @since 2024-08-20
 */
@RestController
@RequestMapping("/claims")
public class ClaimsController {
    @Autowired
    private IClaimsService claimsService;


    @GetMapping("getClaims")
    public Result getClaims(){
        List<Claims> claims= claimsService.list();
        return Result.ok(claims);
    }



//发起审批
    @PostMapping("startApproval")
    public Result startApproval(@RequestBody ApprovalDto approvalDto) {
       InsuranceFlowable1 insuranceFlowable1 = claimsService.startApproval(approvalDto);
        return Result.ok(insuranceFlowable1);
    }
//

}
